﻿using B.S.Sterilizationcenter.Domain.zyy;
using B.S.Sterilizationcenter.ErrorCode;
using B.S.Sterilizationcenter.Read.API.Application.Command;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Sterilizationcenter.Read.API.Controllers.ZYY.Items
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ItemsController : ControllerBase
    {
        private readonly IMediator med;

        public ItemsController(IMediator med)
        {
            this.med = med;
        }

        [HttpGet]
        public Task<ApiResult<List<ItemTable>>> GetItem([FromQuery]GetItem request, CancellationToken cancellationToken)
        {
            return med.Send(request, cancellationToken);
        }
    }
}
